package com.metroinfo.infrastructure;

import java.util.concurrent.ConcurrentHashMap;

import com.metroinfo.infrastructure.keys.LineInfoDataKey;
import com.metroinfo.infrastructure.value.LineStationValue;
import com.metroinfo.interfaces.DataStructInterface;

public class LineStationData implements DataStructInterface {

	ConcurrentHashMap<LineInfoDataKey, LineStationValue> lineStationData = 
		new ConcurrentHashMap<LineInfoDataKey, LineStationValue>();
	
	public LineStationData (int lineCnt, int koliko){
		for(int i=0; i< lineCnt; i++)
		{
			lineStationData.put(new LineInfoDataKey(Integer.valueOf(i)), new LineStationValue(i,koliko));
		}
	}
	
	@Override
	public Object getValue(Object o) {
		return lineStationData.get((LineInfoDataKey)o) ;
	}

	@Override
	public boolean isExists(Object o) {
		return lineStationData.containsKey((LineInfoDataKey)o);
	}

	@Override
	public boolean refresh() {
		return true;
	}

}
